<script>
    nmenuindex=3;
	 function sendurl(p){
            <?
            if($searchkeyartist==$JO["JO_searchid"]){
              ?>
                location=("?JO_unit=009_ArtistII&Page="+p);
                <?
            }else{
                ?>
                location=("?JO_unit=009_ArtistII&Page="+p+"&searchkey=<?=urlencode($searchkeyartist)?>");
                <?
            }
            ?>
            
    }
</script>
<?php
	
 	include ($path.'controller/JO_article_information_Controller.php');

?>


        <div style="width: 960px;background: url(JO_images/hr.gif1) repeat-x top left #222;position: relative;float:left;

             ">
              <? include 'JO_007_nav1.php';?>

            <div class="mar8i"></div>
            <div style="margin-left: 0px;background: url(JO_images/333.png) repeat-y 487px 0px #1a1a1a;" class="bar_720i">
                <div class="bar_480i" style="margin-left: 0px;top:0px">
                    <div class="JO_h1i">Top Artist</div>
                    <div class="mar8i"></div>
                    <div style="float: left;margin-bottom: 8px; width: 472px;">
                   <?php
			 	$reult_count=JO_artist_information_getlist();
				$total=$reult_count->num_rows;
				$page=1;
				$limit=5;
				$i=1;
				if(($total%$limit)!=0) {$numpages=(int)($total/$limit)+1;}
				else                {$numpages=$total/$limit;}
				if(isset ($_REQUEST["Page"])){$page=$_REQUEST["Page"];}
				$vt=(($page-1)*$limit)+1;
				$results=JO_artist_information_getpagelist($vt,$limit);
				if($results!=NULL)
				while($rows=$results->fetch_array()){
			 		
				?>
                
                        <div class="JO_kpopnews_itemi">
                            <div class="JO_newimg">
                                <img src="JO_images/Artist/<?=$rows['image']?>"/>
                            </div>
                            <div class="mar8i"></div>
                            <div class="JO_newscontenti">
                                <a href="?JO_unit=001_artist&artist=<?=md5($rows['key_item'])?>"><b>Name : <?=$rows['name']?></b><br/></a>
                                Thành Lập : <?=$rows['birth']?><br/>
                              	Giới Thiệu: <?=($rows['content']!="")?limit_text($rows['content'],200)."....":" tạm thời chưa có thông tin của artist này ";?>
                                
                            </div>

                        </div>
                    
                        <?php  }?>
                        
                        
                    </div>
                    
                    <div class="mar8i"></div>
                    <div style="float: left;margin-bottom: 8px; width: 472px;">
                        
                      <ul>
                         	<li class="JO_lasti" style="list-style:none;line-height:24px;text-align:center">
                            
                            							<?

               		 if($numpages>1){
                    if($page>2){
                    ?>
              <a href="#" onclick="sendurl('1');">◀</a>
              <?
                    }
                    if($page>1){
                    ?>
              <a href="#" onclick="sendurl('<?=($page-1)?>');">◁</a>
              <?
                    }
                    if($page-4>1) echo "...";
                    for($i=$page-4;$i<=($page-1);$i++){
                        if($i>0){
                        ?>
              <a href="#" onclick="sendurl('<?=$i?>');">
              <?=$i?>
              </a>
              <?
                        }
                    }
                    echo  "<b style='color=#ffffff;'><u>".$page."</u></b>";
                    for($i=$page+1;$i<=($page+4);$i++){
                        if($i<=$numpages){
                        ?>
              <a href="#" onclick="sendurl('<?=$i?>');">
              <?=$i?>
              </a>
              <?
                        }
                    }
                    if($page+4<$numpages) echo "...";
                    if($page<$numpages){
                    ?>
              <a href="#" onclick="sendurl('<?=($page+1) ?>');">▷</a>
              <?
                    }
                    if($page<($numpages-1)){
                    ?>
              <a href="#" onclick="sendurl('<?=$numpages ?>');">▶</a>
              <?
                    }

                }
                 ?>

                            </li>
                        </ul>
                    </div>
                </div>
                <div class="mar8i"></div>
                <? include 'JO_008_nav4.php';?>
            </div>
	
            
        </div>
